package com.seagull.sb.bo.impl;

import java.util.Collections;
import java.util.List;

import javax.imageio.spi.ServiceRegistry;

import com.seagull.sb.bo.NoticeBO;
import com.seagull.sb.bo.StudentBO;
import com.seagull.sb.dao.NoticeDAO;
import com.seagull.sb.dao.StudentDAO;
import com.seagull.sb.domain.Notice;
import com.seagull.sb.domain.Student;
import com.seagull.sb.util.SBRequestContext;
import com.seagull.sb.util.SBUtil;

public class StudentBOImpl extends BaseBOImpl implements StudentBO{
	private StudentDAO studentDAO;
	
	public List<Student> getStudents(SBRequestContext rc){
		Object result;
		try{
			
			 return studentDAO.getStudents(rc);
		}catch(Exception e){
			e.printStackTrace();
		}
		return Collections.EMPTY_LIST;
	}
	
	public List<Student> getStudents(SBRequestContext rc, String searchString){
		Object result;
		try{
			 return studentDAO.getStudents(rc,searchString);
		}catch(Exception e){
			e.printStackTrace();
		}
		return Collections.EMPTY_LIST;
	}	
	
	public List<Student> saveStudent(SBRequestContext rc,Student student){
		
		try {
			student.setDob(SBUtil.getSystemDate());
			studentDAO.saveStudent(rc,student);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return Collections.EMPTY_LIST;
	}

	public StudentDAO getStudentDAO() {
		return studentDAO;
	}

	public void setStudentDAO(StudentDAO studentDAO) {
		this.studentDAO = studentDAO;
	}
	
	
}
